// view/index/saomnum/saomnum.js
let app = getApp()
let yuming = app.globalData.yuming
Page({
  /**
   * 页面的初始数据
   */
  data: {
    yuming: yuming,
    heights: "",
    title: '扫码次数',
    yuelist: [],
    yueindex: 0,
    nodui: false,
    list: [ //0下降红  1上升绿
      {
        year: '2021',
        xian: true,
        lhn: '10000',
        data: [{
            month: '06',
            num: '8455213',
            zhi: '-27',
            type: 0,
          },
          {
            month: '07',
            num: '8455213',
            zhi: '+56',
            type: 1,
          }
        ]
      },
      {
        year: '2020',
        xian: false,
        lhn: '5000',
        data: [{
            month: '08',
            num: '8455213',
            zhi: '+56',
            type: 1
          },
          {
            month: '09',
            num: '8455213',
            zhi: '-27',
            type: 0
          },
          {
            month: '10',
            num: '8455213',
            zhi: '+56',
            type: 1
          },
          {
            month: '11',
            num: '8455213',
            zhi: '+56',
            type: 1
          }
        ]
      },
      {
        year: '2020',
        xian: false,
        lhn: '5000',
        data: [{
            month: '08',
            num: '8455213',
            zhi: '+56',
            type: 1
          },
          {
            month: '09',
            num: '8455213',
            zhi: '-27',
            type: 0
          },
          {
            month: '10',
            num: '8455213',
            zhi: '+56',
            type: 1
          },
          {
            month: '11',
            num: '8455213',
            zhi: '+56',
            type: 1
          }
        ]
      }
    ],
    date: '2020-10-20',
  },
  nodui(e) {
    var aa = e.currentTarget.dataset.aa
    if (aa == 1) {
      wx.navigateTo({
        url: '/my_dian/dui/dui',
      })
    } else {
      this.setData({
        nodui: !this.data.nodui
      })
    }
  },
  duishang() {
    wx.navigateTo({
      url: '/my_dian/dui/dui',
    })
    this.setData({
      nodui: false
    })
  },
  // 月
  bindyue(e) {
    let index = e.detail.value
    this.setData({
      date: e.detail.value
    })
  },
  backs() {
    wx.navigateBack({
      delta: 0
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      heights: wx.getMenuButtonBoundingClientRect().top + 5
    })
    var test = new Date();
    var year = test.getFullYear();
    var month = test.getMonth() + 1
    var ri = test.getDate()
    this.setData({
      date: year + "-" + month + "-" + ri
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },
})